<template>
<view class="w-100 re h-100">
	<scroll-view class="scroll-view_H uni-scroll" scroll-y="true" @scrolltolower="lower" :lower-threshold="200">
		<view class="w-100 px-3 py-2">
			<view class="w-100 h342 circle34 show0 mb-3 bg-theme re" v-for="(item,index) in data_list" :key="index"  @click="get_details(item)">
				<ImgFile :url="item.thumbnail" mode="aspectFill" className="w-100 h272 ab left0 bottom92 z-999"></ImgFile>
				<view class="w-100 bg-white h122 ty-circle-box ab left0 bottom0 z-99">
					<view class="f-b-c w-100 px-3 pl-4">
						<view class="font40 t-20 font700 f-b-c h122">{{item.name}}</view>
						<image src="../../static/icon_right_0.png" class="w44 h44" />
					</view>
					<HornMargin type="left-top" :width="44" :height="40" />
				</view>
			</view>
			<view class="w-100 h200"></view>
		</view>
	</scroll-view>
</view>
</template>

<script>
	import HornMargin from "../../components/horn_margin.vue"
	import ImgFile from "../../components/img_file.vue"
	import {activityUser,activityList} from "../../api/ticket/index.js"
	import Mixin from "../../common/mixin.js"
	export default {
		mixins:[Mixin],
		components:{HornMargin,ImgFile},
        data() {
            return {
               query:{
               	pageSize:10,
               	currentPage:1,
               	type:"VIP_EXCLUSIVE", // 类型 活动:ACTIVITY/课程:COURSE/会员专属：VIP_EXCLUSIVE,
               },
               is_loading:false,
               data_list:[],
            };
        },
	
        created(){
        	this.get_data_list()
        },
        methods: {
        	get_data_list(){
        		activityList(this.query).then(res=>{
        			const {records, current, pages} = res.body
        			this.data_list = [...this.data_list,...records]
        			// 当前页大于总页 显示没有更多了 
        			if(current >= pages){
        				this.is_loading = true
        			}else{
        				this.is_loading = false
        			}
        		})
        	},
        	get_details(val){
        		uni.setStorageSync("details",val)
        		uni.navigateTo({
        			url:"/pages/ticket/vip/details"
        		})
        	}
        },

    };
</script>

<style scoped="scoped" lang="scss">
	.scroll-view_H{
		position: absolute;
		top: 24rpx;
		left: 0;
		bottom: 0;
		right: 0;
		z-index: 9;
	}
	.ty-circle-box{
		border-radius: 0 34rpx 34rpx 34rpx;
	}
</style>